package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.github.kotvertolet.youtubejextractor.models.youtube.playerResponse.*;
import com.github.kotvertolet.youtubejextractor.models.youtube.videoData.StreamingData;
import com.github.kotvertolet.youtubejextractor.models.youtube.videoData.VideoDetails;
import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class VideoPlayerConfig implements Sequenceable, Serializable {

    @SerializedName("playerConfig")
    private PlayerConfig playerConfig;

    @SerializedName("videoDetails")
    private VideoDetails videoDetails;

    @SerializedName("streamingData")
    private StreamingData streamingData;

    @SerializedName("responseContext")
    private ResponseContext responseContext;

    @SerializedName("playabilityStatus")
    private PlayabilityStatus playabilityStatus;

    @SerializedName("messages")
    private List<MessagesItem> messages;

    @SerializedName("playbackTracking")
    private PlaybackTracking playbackTracking;

    @SerializedName("microformat")
    private Microformat microformat;



    public static final Sequenceable.Producer<VideoPlayerConfig> CREATOR = new Producer<VideoPlayerConfig>() {
        @Override
        public VideoPlayerConfig createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            VideoPlayerConfig videoPlayerConfig = new VideoPlayerConfig();
            videoPlayerConfig.unmarshalling(parcel);
            return videoPlayerConfig;
        }
    };
   
    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.playerConfig);
        parcel.writeSequenceable(this.videoDetails);
        parcel.writeSequenceable(this.streamingData);
        parcel.writeSequenceable(this.responseContext);
        parcel.writeSequenceable(this.playabilityStatus);
        parcel.writeList(this.messages);
        parcel.writeSequenceable(this.playbackTracking);
        parcel.writeSequenceable(this.microformat);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.playerConfig);
        parcel.readSequenceable(this.videoDetails);
        parcel.readSequenceable(this.streamingData);
        parcel.readSequenceable(this.responseContext);
        parcel.readSequenceable(this.playabilityStatus);
        this.messages = parcel.readSequenceableList(MessagesItem.class);
        parcel.readSequenceable(this.playbackTracking);
        parcel.readSequenceable(this.microformat);
        return true;
    }

    @Override
    public String toString() {
        return "VideoPlayerConfig{" +
                "playerConfig=" + playerConfig +
                ", videoDetails=" + videoDetails +
                ", streamingData=" + streamingData +
                ", responseContext=" + responseContext +
                ", playabilityStatus=" + playabilityStatus +
                ", messages=" + messages +
                ", playbackTracking=" + playbackTracking +
                ", microformat=" + microformat +
                '}';
    }

    public PlayerConfig getPlayerConfig() {
        return playerConfig;
    }

    public void setPlayerConfig(PlayerConfig playerConfig) {
        this.playerConfig = playerConfig;
    }

    public VideoDetails getVideoDetails() {
        return videoDetails;
    }

    public void setVideoDetails(VideoDetails videoDetails) {
        this.videoDetails = videoDetails;
    }

    public StreamingData getStreamingData() {
        return streamingData;
    }

    public void setStreamingData(StreamingData streamingData) {
        this.streamingData = streamingData;
    }

    public ResponseContext getResponseContext() {
        return responseContext;
    }

    public void setResponseContext(ResponseContext responseContext) {
        this.responseContext = responseContext;
    }

    public PlayabilityStatus getPlayabilityStatus() {
        return playabilityStatus;
    }

    public void setPlayabilityStatus(PlayabilityStatus playabilityStatus) {
        this.playabilityStatus = playabilityStatus;
    }

    public List<MessagesItem> getMessages() {
        return messages;
    }

    public void setMessages(List<MessagesItem> messages) {
        this.messages = messages;
    }

    public PlaybackTracking getPlaybackTracking() {
        return playbackTracking;
    }

    public void setPlaybackTracking(PlaybackTracking playbackTracking) {
        this.playbackTracking = playbackTracking;
    }

    public Microformat getMicroformat() {
        return microformat;
    }

    public void setMicroformat(Microformat microformat) {
        this.microformat = microformat;
    }
}
